import { createElement } from "react";
import { Input, Select } from "antd";

import type { FilterItem } from "@yaf/pro-ui";
import { getEnv } from '@/constants';

export const getFilterItems = (): FilterItem[] => {
  const { commonStatus, commonStatusList } = getEnv().globalConfig;
  return [
    {
      title: "关键字",
      name: "keyWords",
      gridSpan: 1,
      component: createElement(Input, { placeholder: "用户名或昵称" }),
    },
    {
      title: "手机",
      name: "mobile",
      gridSpan: 1,
      component: createElement(Input),
    },
    {
      title: "状态",
      name: "status",
      gridSpan: 1,
      component: createElement(Select, { options: commonStatusList, allowClear: true, style: { width: "100%" } }),
      defaultValue: commonStatus.normal
    },
  ];
}
